package com.weizhizs.assistant.code.config;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author wutianbin
 * @version 1.0
 * @Time: 2017年5月18日 下午7:29:10
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class DbConfig extends PropertiesConfig {

    private static DbConfig _INSTANCE;

    private String dbDriver;
    private String dbUrl;
    private String dbUserName;
    private String dbPassword;
    private String dbSchema;

    public DbConfig() {
        super();

        this.dbDriver = config.getString("dbDriver");
        this.dbUrl = config.getString("dbUrl");
        this.dbUserName = config.getString("dbUserName");
        this.dbPassword = config.getString("dbPassword");
        this.dbSchema = config.getString("dbSchema");
    }

    public static DbConfig getInstance() {
        if (null == _INSTANCE) {
            _INSTANCE = new DbConfig();
        }
        return _INSTANCE;
    }

    public String getDbDriver() {
        return dbDriver;
    }

    public void setDbDriver(String dbDriver) {
        this.dbDriver = dbDriver;
    }

    public String getDbUrl() {
        return dbUrl;
    }

    public void setDbUrl(String dbUrl) {
        this.dbUrl = dbUrl;
    }

    public String getDbUserName() {
        return dbUserName;
    }

    public void setDbUserName(String dbUserName) {
        this.dbUserName = dbUserName;
    }

    public String getDbPassword() {
        return dbPassword;
    }

    public void setDbPassword(String dbPassword) {
        this.dbPassword = dbPassword;
    }

    public String getDbSchema() {
        return dbSchema;
    }

    public void setDbSchema(String dbSchema) {
        this.dbSchema = dbSchema;
    }
}
